import { Body, Controller, Post } from '@nestjs/common';
import R from 'libs/common/utils/R';
import CreateResourceDto from '../dto/CreateResourceDto';
import ResourceService from '../service/resource.service';

@Controller('/resource')
export default class ResourceController {
  constructor(private readonly resourceService: ResourceService) {}

  @Post('/create')
  async create(@Body() createResourceDto: CreateResourceDto): Promise<R<any>> {
    await this.resourceService.create(createResourceDto);
    return R.ok();
  }
}
